/**
 * 
 */
package com.warehouse.management.controllers;

import java.util.List;

import javax.persistence.EntityManager;

import com.warehouse.management.connection.EntityManagerConnection;
import com.warehouse.management.interfaces.IClientRepository;
import com.warehouse.management.models.Client;
import com.warehouse.management.models.Order;

/**
 * @author Virtual7-1
 * 
 */
public class ClientController implements IClientRepository<Client> {

    public EntityManagerConnection connection = new EntityManagerConnection(
						      "root", "mondeo1800",
						      "uss",
						      "jdbc:mysql://localhost:3306/");
    public EntityManager	   entityManager;

    public Client		  client;

    @Override
    public Client getById(Long id) {
	entityManager = connection.openConnection();
	this.client = entityManager.find(Client.class, id);
	connection.closeConnection();

	return this.client;
    }

    @Override
    public void add(Client entity) {
	// TODO Auto-generated method stub

    }

    @Override
    public void update(Client entity) {
	// TODO Auto-generated method stub

    }

    @Override
    public void delete(Client entity) {
	// TODO Auto-generated method stub

    }

    @Override
    public void delete(Long id) {
	// TODO Auto-generated method stub

    }

    @Override
    public void detach(Client entity) {
	// TODO Auto-generated method stub

    }

    @Override
    public List<Order> getOrdersForClient() {
	// TODO Auto-generated method stub
	return null;
    }

}
